import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login')
  },
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home'),
    // redirect: { path: '/Market' },
    meta: {
      chineseName: '首页'
    },
    children: [
      {
        path: '/Account',
        name: 'Account',
        icon: '',
        component: () => import('../views/Account/index'),
        meta: {
          chineseName: '账户'
        },
        children: [
          {
            path: '/Account',
            name: 'Account_management',
            icon: '',
            component: () => import('../views/Account/component/Account_management'),
            meta: {
              chineseName: '账户管理'
            }
          }
        ]
      },
      {
        path: '/Market',
        name: 'Market',
        icon: '',
        component: () => import('../views/Market/index'),
        meta: {
          chineseName: '行情'
        }
      },
      {
        path: '/Price',
        name: 'Price',
        icon: '',
        component: () => import('../views/Price/index'),
        meta: {
          chineseName: '定价'
        }
      },
      {
        path: '/Trade',
        name: 'Trade',
        icon: '',
        component: () => import('../views/Trade/index'),
        meta: {
          chineseName: '交易'
        },
        children: [
          {
            path: '/Price/parameter',
            name: 'parameter',
            icon: '',
            meta: {
              chineseName: '策略参数'
            },
            children: [
              {
                path: '/Price/parameter/contract_parameter',
                name: 'Price_parameter',
                icon: '',
                component: () => import('../views/Trade/component/parameter/contract_parameter'),
                meta: {
                  chineseName: '合约参数'
                }
              }
            ]
          }
        ]
      },
      {
        path: '/Search',
        name: 'Search',
        icon: '',
        component: () => import('../views/Search/index'),
        meta: {
          chineseName: '查询'
        }
      },
      {
        path: '/Risk',
        name: 'Risk',
        icon: '',
        component: () => import('../views/Rise/index'),
        meta: {
          chineseName: '风控'
        }
      },
      {
        path: '/Settlement',
        name: 'Settlement',
        icon: '',
        component: () => import('../views/Settlement/index'),
        meta: {
          chineseName: '结算'
        }
      },
      {
        path: '/Monitor',
        name: 'Monitor',
        icon: '',
        component: () => import('../views/Monitor/index'),
        meta: {
          chineseName: '监控'
        }
      },
      {
        path: '/Setting',
        name: 'Setting',
        icon: '',
        component: () => import('../views/Setting/index'),
        meta: {
          chineseName: '设置'
        }
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
